Optimal. Leaf size=49 \[ \frac {3 \tanh ^{-1}(\cos (a+b x))}{2 b}-\frac {3 \cos (a+b x)}{2 b}-\frac {\cos (a+b x) \cot ^2(a+b x)}{2 b} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.02, antiderivative size = 49, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 4, integrand size = 15, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.267, Rules used = {2672, 294, 327,
212} \begin {gather*} -\frac {3 \cos (a+b x)}{2 b}-\frac {\cos (a+b x) \cot ^2(a+b x)}{2 b}+\frac {3 \tanh ^{-1}(\cos (a+b x))}{2 b} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 212
Rule 294
Rule 327
Rule 2672
Rubi steps
\begin {align*} \int \cos (a+b x) \cot ^3(a+b x) \, dx &=-\frac {\text {Subst}\left (\int \frac {x^4}{\left (1-x^2\right )^2} \, dx,x,\cos (a+b x)\right )}{b}\\ &=-\frac {\cos (a+b x) \cot ^2(a+b x)}{2 b}+\frac {3 \text {Subst}\left (\int \frac {x^2}{1-x^2} \, dx,x,\cos (a+b x)\right )}{2 b}\\ &=-\frac {3 \cos (a+b x)}{2 b}-\frac {\cos (a+b x) \cot ^2(a+b x)}{2 b}+\frac {3 \text {Subst}\left (\int \frac {1}{1-x^2} \, dx,x,\cos (a+b x)\right )}{2 b}\\ &=\frac {3 \tanh ^{-1}(\cos (a+b x))}{2 b}-\frac {3 \cos (a+b x)}{2 b}-\frac {\cos (a+b x) \cot ^2(a+b x)}{2 b}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.02, size = 86, normalized size = 1.76 \begin {gather*} -\frac {\cos (a+b x)}{b}-\frac {\csc ^2\left (\frac {1}{2} (a+b x)\right )}{8 b}+\frac {3 \log \left (\cos \left (\frac {1}{2} (a+b x)\right )\right )}{2 b}-\frac {3 \log \left (\sin \left (\frac {1}{2} (a+b x)\right )\right )}{2 b}+\frac {\sec ^2\left (\frac {1}{2} (a+b x)\right )}{8 b} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.04, size = 60, normalized size = 1.22
method | result | size |
derivativedivides | \(\frac {-\frac {\cos ^{5}\left (b x +a \right )}{2 \sin \left (b x +a \right )^{2}}-\frac {\left (\cos ^{3}\left (b x +a \right )\right )}{2}-\frac {3 \cos \left (b x +a \right )}{2}-\frac {3 \ln \left (\csc \left (b x +a \right )-\cot \left (b x +a \right )\right )}{2}}{b}\) | \(60\) |
default | \(\frac {-\frac {\cos ^{5}\left (b x +a \right )}{2 \sin \left (b x +a \right )^{2}}-\frac {\left (\cos ^{3}\left (b x +a \right )\right )}{2}-\frac {3 \cos \left (b x +a \right )}{2}-\frac {3 \ln \left (\csc \left (b x +a \right )-\cot \left (b x +a \right )\right )}{2}}{b}\) | \(60\) |
norman | \(\frac {-\frac {1}{8 b}+\frac {\tan ^{6}\left (\frac {b x}{2}+\frac {a}{2}\right )}{8 b}-\frac {9 \left (\tan ^{2}\left (\frac {b x}{2}+\frac {a}{2}\right )\right )}{4 b}}{\left (1+\tan ^{2}\left (\frac {b x}{2}+\frac {a}{2}\right )\right ) \tan \left (\frac {b x}{2}+\frac {a}{2}\right )^{2}}-\frac {3 \ln \left (\tan \left (\frac {b x}{2}+\frac {a}{2}\right )\right )}{2 b}\) | \(82\) |
risch | \(-\frac {{\mathrm e}^{i \left (b x +a \right )}}{2 b}-\frac {{\mathrm e}^{-i \left (b x +a \right )}}{2 b}+\frac {{\mathrm e}^{3 i \left (b x +a \right )}+{\mathrm e}^{i \left (b x +a \right )}}{b \left ({\mathrm e}^{2 i \left (b x +a \right )}-1\right )^{2}}-\frac {3 \ln \left ({\mathrm e}^{i \left (b x +a \right )}-1\right )}{2 b}+\frac {3 \ln \left ({\mathrm e}^{i \left (b x +a \right )}+1\right )}{2 b}\) | \(100\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.29, size = 56, normalized size = 1.14 \begin {gather*} \frac {\frac {2 \, \cos \left (b x + a\right )}{\cos \left (b x + a\right )^{2} - 1} - 4 \, \cos \left (b x + a\right ) + 3 \, \log \left (\cos \left (b x + a\right ) + 1\right ) - 3 \, \log \left (\cos \left (b x + a\right ) - 1\right )}{4 \, b} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.41, size = 83, normalized size = 1.69 \begin {gather*} -\frac {4 \, \cos \left (b x + a\right )^{3} - 3 \, {\left (\cos \left (b x + a\right )^{2} - 1\right )} \log \left (\frac {1}{2} \, \cos \left (b x + a\right ) + \frac {1}{2}\right ) + 3 \, {\left (\cos \left (b x + a\right )^{2} - 1\right )} \log \left (-\frac {1}{2} \, \cos \left (b x + a\right ) + \frac {1}{2}\right ) - 6 \, \cos \left (b x + a\right )}{4 \, {\left (b \cos \left (b x + a\right )^{2} - b\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 241 vs.
\(2 (42) = 84\).
time = 0.94, size = 241, normalized size = 4.92 \begin {gather*} \begin {cases} - \frac {12 \log {\left (\tan {\left (\frac {a}{2} + \frac {b x}{2} \right )} \right )} \tan ^{4}{\left (\frac {a}{2} + \frac {b x}{2} \right )}}{8 b \tan ^{4}{\left (\frac {a}{2} + \frac {b x}{2} \right )} + 8 b \tan ^{2}{\left (\frac {a}{2} + \frac {b x}{2} \right )}} - \frac {12 \log {\left (\tan {\left (\frac {a}{2} + \frac {b x}{2} \right )} \right )} \tan ^{2}{\left (\frac {a}{2} + \frac {b x}{2} \right )}}{8 b \tan ^{4}{\left (\frac {a}{2} + \frac {b x}{2} \right )} + 8 b \tan ^{2}{\left (\frac {a}{2} + \frac {b x}{2} \right )}} + \frac {\tan ^{6}{\left (\frac {a}{2} + \frac {b x}{2} \right )}}{8 b \tan ^{4}{\left (\frac {a}{2} + \frac {b x}{2} \right )} + 8 b \tan ^{2}{\left (\frac {a}{2} + \frac {b x}{2} \right )}} - \frac {18 \tan ^{2}{\left (\frac {a}{2} + \frac {b x}{2} \right )}}{8 b \tan ^{4}{\left (\frac {a}{2} + \frac {b x}{2} \right )} + 8 b \tan ^{2}{\left (\frac {a}{2} + \frac {b x}{2} \right )}} - \frac {1}{8 b \tan ^{4}{\left (\frac {a}{2} + \frac {b x}{2} \right )} + 8 b \tan ^{2}{\left (\frac {a}{2} + \frac {b x}{2} \right )}} & \text {for}\: b \neq 0 \\\frac {x \cos ^{4}{\left (a \right )}}{\sin ^{3}{\left (a \right )}} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 140 vs.
\(2 (43) = 86\).
time = 4.22, size = 140, normalized size = 2.86 \begin {gather*} -\frac {\frac {\frac {14 \, {\left (\cos \left (b x + a\right ) - 1\right )}}{\cos \left (b x + a\right ) + 1} + \frac {3 \, {\left (\cos \left (b x + a\right ) - 1\right )}^{2}}{{\left (\cos \left (b x + a\right ) + 1\right )}^{2}} - 1}{\frac {\cos \left (b x + a\right ) - 1}{\cos \left (b x + a\right ) + 1} - \frac {{\left (\cos \left (b x + a\right ) - 1\right )}^{2}}{{\left (\cos \left (b x + a\right ) + 1\right )}^{2}}} + \frac {\cos \left (b x + a\right ) - 1}{\cos \left (b x + a\right ) + 1} + 6 \, \log \left (\frac {{\left | -\cos \left (b x + a\right ) + 1 \right |}}{{\left | \cos \left (b x + a\right ) + 1 \right |}}\right )}{8 \, b} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.54, size = 77, normalized size = 1.57 \begin {gather*} \frac {{\mathrm {tan}\left (\frac {a}{2}+\frac {b\,x}{2}\right )}^2}{8\,b}-\frac {3\,\ln \left (\mathrm {tan}\left (\frac {a}{2}+\frac {b\,x}{2}\right )\right )}{2\,b}-\frac {\frac {17\,{\mathrm {tan}\left (\frac {a}{2}+\frac {b\,x}{2}\right )}^2}{8}+\frac {1}{8}}{b\,\left ({\mathrm {tan}\left (\frac {a}{2}+\frac {b\,x}{2}\right )}^4+{\mathrm {tan}\left (\frac {a}{2}+\frac {b\,x}{2}\right )}^2\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________